home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 295_01 / bgeth.c < prev    next >
Text File  |  1989-12-28  |  1KB  |  47 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "bgeth.c    1.2 - 89/10/31" */
  5.  
  6. /*#include <stddef.h>*/
  7. #include "blkio_.h"
  8.  
  9. /*man---------------------------------------------------------------------------
  10. NAME
  11.      bgeth - get the header from a block file
  12.  
  13. SYNOPSIS
  14.      #include <blkio.h>
  15.  
  16.      int bgeth(bp, buf)
  17.      BLKFILE *bp;
  18.      void *buf;
  19.  
  20. DESCRIPTION
  21.      The bgeth function reads the header from the block file
  22.      associated with BLKFILE pointer bp.  buf must point to a storage
  23.      area at least as large as the header size for bp.
  24.  
  25.      bgeth will fail if one or more of the following is true:
  26.  
  27.      [EINVAL]       bp is not a valid block file.
  28.      [EINVAL]       buf is NULL.
  29.      [BEEOF]        bp is empty.
  30.      [BEEOF]        End of file encountered within header.
  31.      [BENOPEN]      bp is not open for reading.
  32.  
  33. SEE ALSO
  34.      bgetb, bgethf, bputh.
  35.  
  36. DIAGNOSTICS
  37.      Upon successful completion, a value of 0 is returned.  Otherwise,
  38.      a value of -1 is returned, and errno set to indicate the error.
  39.  
  40. ------------------------------------------------------------------------------*/
  41. int bgeth(bp, buf)
  42. BLKFILE *bp;
  43. void *buf;
  44. {
  45.     return bgethf(bp, (size_t)0, buf, bp->hdrsize);
  46. }
  47.